<template>
  <div>
    <div class="head-top">
      <mt-header :title="pdf_title" style="padding: 0 10px">
        <mt-button icon="back" slot="left" @click='back()'></mt-button>
      </mt-header>
    </div>

    <iframe :src="'./static/pdf/web/viewer.html?file='+this.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  </div>
</template>

<script>
export default {
  data() {
    return {
      pdf_title: ""
    };
  },
  created() {
    this.pdfUrl = this.$route.params.bookurl;
    this.pdf_title = this.$route.params.bookName;
  },
  methods: {
    back() {
      this.$router.go(-1);
    }
  }
};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: #000000;
}

body {
  display: flex;
  -webkit-align-items: center;
  -webkit-justify-content: center;
}
</style>